package com.itheima.test;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * @Author:gy
 * @Date: 2025/09/06 9:43
 * @Description:
 */
public class Demo1 {
    public static void main(String[] args) throws Exception {
        //获取系统类加载器
        ClassLoader sl = ClassLoader.getSystemClassLoader();
        //利用加载器去加载一个指定的文件
        InputStream is = sl.getResourceAsStream("prop.properties");
        //字节输入流和Properties
        Properties prop = new Properties();
        prop.load(is);
        System.out.println(prop);
        is.close();
    }
}
